<?php
Route::group(['prefix'=>'admin'], function() {
    //----------------权限---------------
    Route::group(['middleware' => 'permission'], function () {

        //=======================后台请求=============================
        Route::get('/index/index', ['uses' => 'IndexController@index']);  //后台管理首页
        Route::get('/console', ['uses' => 'IndexController@console']);   //后台控制台
        //=======================用户中心请求=============================
        Route::get('/member/index', ['uses' => 'MemberController@index']);   //用户列表页界面显示
        Route::get('/member/edit/{uid}', ['uses' => 'MemberController@edit']);   //用户列表页界面显示
        Route::get('/member/add', ['uses' => 'MemberController@add']);   //用户添加Route::get('/menu/index', ['uses' => 'MenuController@index']);   //菜单界面显示
        Route::get('/member/change/role', ['uses' => 'MemberController@changeRole']);   //用户选择角色
        //=======================系统配置=============================
        Route::get('/config/group', ['uses' => 'ConfigController@group']);   //系统配置列表
        Route::get('/config/add', ['uses' => 'ConfigController@add']);   //系统配置列表
        Route::get('/config/edit/{id}', ['uses' => 'ConfigController@edit']);   //系统配置列表
        //=======================系统配置分类=============================
        Route::get('/config/class/index', ['uses' => 'ConfigController@classIndex']);   //系统配置列表
        Route::get('/config/class/show_select_menus', ['uses' => 'ConfigController@classSelectMenus']);   //选择分类


        //=========================菜单===================================
        Route::get('/menu/index', ['uses' => 'MenuController@index']);   //菜单界面显示
        Route::get('/menu/show_select_menus', ['uses' => 'MenuController@show_select_menus']);   //菜单界面显示

        //===========================权限管理====================================================
        Route::get('/auth/manager/index', ['uses' => 'AuthManagerController@index']);   //角色组
        Route::get('/auth/manager/menu', ['uses' => 'AuthManagerController@menu']);   //分配选择
        Route::get('/auth/manager/add', ['uses' => 'AuthManagerController@add']);   //添加权限
        Route::get('/auth/manager/edit', ['uses' => 'AuthManagerController@edit']);   //编辑权限组
        //===========================用户行为====================================================
        Route::get('/user/action/index', ['uses' => 'ActionController@index']);   //用户行为
        Route::get('/user/action/add', ['uses' => 'ActionController@add']);   //添加行为
        Route::get('/user/action/edit', ['uses' => 'ActionController@edit']);   //编辑行为
        //==========================用户行为日志======================================================
        Route::get('/user/actionlog/index', ['uses' => 'ActionController@logIndex']);   //编辑行为

        //===============================数据库操作===========================================================
        Route::get('database/option/index', ['uses' => 'DatabaseController@export']);   //备份数据
        Route::get('database/option/import', ['uses' => 'DatabaseController@import']);   //数据还原

    });
  //--------------权限加响应-------------------------
    Route::group(['middleware' => ['permission','response','transaction']], function () {
        //=======================登陆日志表=====================
        Route::post('/index/login/log', ['uses' => 'IndexController@userLoginLog']);  //后台管理首页
        //=======================用户提交操作=============================
        Route::post('/member/index', ['uses' => 'MemberController@index']);//用户列表数据查询
        Route::post('/member/edit', ['uses' => 'MemberController@edit']);   //用户列表页界面显示
        Route::post('/member/del', ['uses' => 'MemberController@del']);   //用户删除
        Route::post('/member/optgg', ['uses' => 'MemberController@optgg']);   //用户删除
        Route::post('/member/add', ['uses' => 'MemberController@add']);   //用户列表页界面显示
        Route::post('/member/change/role', ['uses' => 'MemberController@changeRole']);   //用户保存角色
        //=======================菜单提交操作=============================
        Route::post('/menu/save', ['uses' => 'MenuController@save']);   //菜单界面显示
        Route::post('/menu/edit', ['uses' => 'MenuController@edit']);   //菜单界面显示
        //========================系统配置=====================================
        Route::post('/config/group', ['uses' => 'ConfigController@group']);   //配置列表
        Route::post('/config/add', ['uses' => 'ConfigController@add']);   //配置添加
        Route::post('/config/edit', ['uses' => 'ConfigController@edit']);   //配置编辑
        Route::post('/config/del', ['uses' => 'ConfigController@del']);   //配置编辑
        //-------系统配置分类
        Route::post('/config/class/edit', ['uses' => 'ConfigController@classEdit']);   //系统配置列表
        Route::post('/config/class/save', ['uses' => 'ConfigController@classSave']);   //系统配置列表
        Route::post('/config/class/del', ['uses' => 'ConfigController@classDel']);   //系统配置列表

        //===========================权限管理====================================================
        Route::post('/auth/manager/index', ['uses' => 'AuthManagerController@index']);   //菜单界面显示
        Route::post('/auth/manager/menu', ['uses' => 'AuthManagerController@menu']);   //分配选择
        Route::post('/auth/manager/add', ['uses' => 'AuthManagerController@add']);   //添加权限
        Route::post('/auth/manager/edit', ['uses' => 'AuthManagerController@edit']);   //编辑权限组
        Route::post('/auth/manager/del', ['uses' => 'AuthManagerController@del']);   //删除权限组
        //===========================用户行为====================================================
        Route::post('/user/action/index', ['uses' => 'ActionController@index']);   //用户行为
        Route::post('/user/action/add', ['uses' => 'ActionController@add']);   //添加行为
        Route::post('/user/action/edit', ['uses' => 'ActionController@edit']);   //编辑行为
        Route::post('/user/action/del', ['uses' => 'ActionController@del']);   //删除行为
        //=============================用户行为日志=====================================================
        Route::post('/user/actionlog/index', ['uses' => 'ActionController@logIndex']);   //编辑行为
        Route::post('/user/actionlog/del', ['uses' => 'ActionController@logDel']);   //编辑行为日志删除
        //===============================数据库操作======================================================
        Route::post('database/option/exprot', ['uses' => 'DatabaseController@exportSave']);   //备份所有数据
        Route::get('database/option/exprot', ['uses' => 'DatabaseController@exportSave']);   //备份所有数据
    });
    //响应
    Route::group(['middleware' => ['response']], function () {
        Route::post('/public/login', ['uses' => 'PublicController@login']);//用户数据提交登陆
        Route::get('/public/logout', ['uses' => 'PublicController@logout']);   //用户登陆
    });
    Route::get('/public/login', ['uses' => 'PublicController@login']);   //用户登陆
    Route::get('/login/otp', ['uses' => 'PublicController@loginOtp']);   //opt
    Route::get('/login/log', ['uses' => 'PublicController@loginLog']);   //opt
    Route::get('/login/otp_code', ['uses' => 'PublicController@getOptCode']);   //opt
});